package com.itzmn.java.javase.collections;


import java.util.ArrayList;
import java.util.LinkedList;
import java.util.Set;

/**
 * @Author: 张梦楠
 * @Date: 2018/12/5 20:26
 * 简书：https://www.jianshu.com/u/d611be10d1a6
 * 码云：https://gitee.com/zhangqiye
 * @Description:
 */
public class Test {


    public static void main(String[] args) {

        new Test().test("我是a,Z b,3,9");

    }

    public void test(String s){
        char[] chars = s.toCharArray();
        String[] split = s.split("");
        StringBuilder stringBuilder = new StringBuilder();
        for (int i =0;i<chars.length;i++){
            if (chars[i] <= 90 && chars[i] >= 65){
                chars[i]+=32;
                stringBuilder.append(chars[i]);
                continue;
            }else if(chars[i]>=97 && chars[i]<=122){
                chars[i]-=32;
                stringBuilder.append(chars[i]);
                continue;
            }else if(chars[i]>=48 && chars[i]<=57){

              chars[i] = (char)(57 - chars[i] + 48);
                stringBuilder.append(chars[i]);
              continue;
            }
            stringBuilder.append(chars[i]);
        }

        System.out.println(stringBuilder.toString());
        String string = new String(chars);
        System.out.println(string);


    }
}
